package cn.edu.xmu.tangzk.scala.s99

object P15 {

    def duplicateN[A](n: Int, ls: List[A]): List[A] = {
        ls flatMap { List.make(n, _) }
    }

    def main(args: Array[String]) {
        println(duplicateN(3, List('a, 'b, 'c, 'c, 'd)))
    }

}